package o;

import android.content.Context;
import android.content.ContextWrapper;
import android.widget.ImageView;
import androidx.annotation.GuardedBy;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.bumptech.glide.Glide.d;
import com.bumptech.glide.Registry;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

public class rh extends ContextWrapper {
    @VisibleForTesting
    static final rq<?, ?> ˎ = new rc();
    private final to ʻ;
    private final int ʼ;
    private final List<zn<Object>> ʽ;
    private final d ˊ;
    private final Registry ˋ;
    private final zt ˏ;
    @GuardedBy("this")
    @Nullable
    private zp ˏॱ;
    private final ud ॱ;
    private final Map<Class<?>, rq<?, ?>> ॱॱ;
    private final boolean ᐝ;

    public rh(@NonNull Context context, @NonNull ud udVar, @NonNull Registry registry, @NonNull zt ztVar, @NonNull d dVar, @NonNull Map<Class<?>, rq<?, ?>> map, @NonNull List<zn<Object>> list, @NonNull to toVar, boolean z, int i) {
        super(context.getApplicationContext());
        this.ॱ = udVar;
        this.ˋ = registry;
        this.ˏ = ztVar;
        this.ˊ = dVar;
        this.ʽ = list;
        this.ॱॱ = map;
        this.ʻ = toVar;
        this.ᐝ = z;
        this.ʼ = i;
    }

    public List<zn<Object>> ˎ() {
        return this.ʽ;
    }

    public synchronized zp ˋ() {
        if (this.ˏॱ == null) {
            this.ˏॱ = (zp) this.ˊ.ˎ().ˋॱ();
        }
        return this.ˏॱ;
    }

    @NonNull
    public <T> rq<?, T> ˏ(@NonNull Class<T> cls) {
        rq<?, T> rqVar = (rq) this.ॱॱ.get(cls);
        if (rqVar == null) {
            rq<?, T> rqVar2 = rqVar;
            for (Entry entry : this.ॱॱ.entrySet()) {
                if (((Class) entry.getKey()).isAssignableFrom(cls)) {
                    rqVar = (rq) entry.getValue();
                } else {
                    rqVar = rqVar2;
                }
                rqVar2 = rqVar;
            }
            rqVar = rqVar2;
        }
        if (rqVar == null) {
            return ˎ;
        }
        return rqVar;
    }

    @NonNull
    public <X> aab<ImageView, X> ˏ(@NonNull ImageView imageView, @NonNull Class<X> cls) {
        return this.ˏ.ˋ(imageView, cls);
    }

    @NonNull
    public to ˏ() {
        return this.ʻ;
    }

    @NonNull
    public Registry ॱ() {
        return this.ˋ;
    }

    public int ˊ() {
        return this.ʼ;
    }

    @NonNull
    public ud ʻ() {
        return this.ॱ;
    }

    public boolean ʼ() {
        return this.ᐝ;
    }
}
